# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=libtins
pkgver=4.5
pkgrel=1
pkgdesc="A high-level, multiplatform C++ network packet sniffing and crafting library"
url="http://libtins.github.io/"
arch="all"
license="BSD-2-Clause"
options="!check"
makedepends="libpcap-dev openssl-dev>3 boost-dev cmake"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/mfontanini/libtins/archive/v$pkgver.tar.gz"

prepare() {
	default_prepare
	mkdir -p build
}

build() {
	cd build
	cmake -DCMAKE_INSTALL_PREFIX=/usr \
		-DLIBTINS_ENABLE_CXX11=yes \
		../
	make
}

package() {
	cd build
	make DESTDIR="$pkgdir" install
	install -Dm644 ../LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
sha512sums="
d8887949cb545dbaf4247c8405feb5cc1032f370bb418dd5344043dc97555b1b826a8d33cfc7dd0a7a9a9af6f3a46bd6fcbed89f98d5eb23fdd10294f823fcd6  libtins-4.5.tar.gz
"
